#导入正则匹配re模块
import re
import os

def deleteHtmlTags(strHtml):
    """
    这段代码是从网上抄的

    :param strHtml: 包含有网页标记的文本
    :return: 返回不含网页标记的文本
    """


    dr = re.compile(r'<[^>]+>',re.S)

    retstr = dr.sub('',strHtml)

    return retstr

def download_image(img_url,fileName):

    from urllib.request import urlretrieve

    image_path = os.path.abspath('.')+'/image/'+fileName

    urlretrieve(img_url, image_path)

    return image_path

def urlTofileName(url = ""):

    if url=="":

        return ""

    lst = url.split("/")

    return lst[len(lst)-1]

